package com.yanqu.road.entity.autodata.hotpotjump.config;

import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.autodata.AutoActivityConfigObject;
import com.yanqu.road.utils.string.StringUtils;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_s_activity_hotpotjump_model")
public class HotpotJumpModelConfig extends AutoActivityConfigObject {
    @FieldTypeAnnotation(select = true, orderASC = true, isIndex = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "id", isIndex = true)
    private int id;
    @FieldTypeAnnotation(desc = "")
    private int type;
    @FieldTypeAnnotation(desc = "")
    private int hp;
    @FieldTypeAnnotation(desc = "")
    private int atk;
    @FieldTypeAnnotation(desc = "")
    private int atkRange;
    @FieldTypeAnnotation(desc = "")
    private int actionNum;
    @FieldTypeAnnotation(desc = "")
    private int criticalRate;
    @FieldTypeAnnotation(desc = "")
    private int score;
    @FieldTypeAnnotation(desc = "")
    private int quality;
    @FieldTypeAnnotation(desc = "普通次数")
    private int normalSkill;
    @FieldTypeAnnotation(desc = "特殊机制技能")
    private String specialSkill;
    @FieldTypeAnnotation(desc = "")
    private String name;
    @FieldTypeAnnotation(desc = "")
    private String desc;
    @FieldTypeAnnotation(desc = "")
    private String coordinate;
    @FieldTypeAnnotation(desc = "")
    private String offset;

    private List<List<Integer>> bornPosList = new ArrayList<>();
    private List<List<Integer>> offsetList = new ArrayList<>();

//    public HotpotJumpModelConfig(ResultSet rs) throws SQLException {
//        this.activityId = rs.getInt("activityId");
//        this.id = rs.getInt("id");
//        this.name = rs.getString("name");
//        this.desc = rs.getString("desc");
//        this.type = rs.getInt("type");
//        this.hp = rs.getInt("hp");
//        this.atk = rs.getInt("atk");
//        this.atkRange = rs.getInt("atkRange");
//        this.actionNum = rs.getInt("actionNum");
//        this.criticalRate = rs.getInt("criticalRate");
//        this.score = rs.getInt("score");
//        this.name = rs.getString("name");
//        this.desc = rs.getString("desc");
//    }

    public int getActivityId() {
        return activityId;
    }

    public int getId() {
        return id;
    }

    public int getType() {
        return type;
    }

    public int getHp() {
        return hp;
    }

    public int getAtk() {
        return atk;
    }

    public int getAtkRange() {
        return atkRange;
    }

    public int getActionNum() {
        return actionNum;
    }

    public int getCriticalRate() {
        return criticalRate;
    }

    public int getScore() {
        return score;
    }

    public int getQuality() {
        return quality;
    }

    public void setQuality(int quality) {
        this.quality = quality;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setType(int type) {
        this.type = type;
    }

    public void setHp(int hp) {
        this.hp = hp;
    }

    public void setAtk(int atk) {
        this.atk = atk;
    }

    public void setAtkRange(int atkRange) {
        this.atkRange = atkRange;
    }

    public void setActionNum(int actionNum) {
        this.actionNum = actionNum;
    }

    public void setCriticalRate(int criticalRate) {
        this.criticalRate = criticalRate;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public int getNormalSkill() {
        return normalSkill;
    }

    public void setNormalSkill(int normalSkill) {
        this.normalSkill = normalSkill;
    }

    public String getSpecialSkill() {
        return specialSkill;
    }

    public void setSpecialSkill(String specialSkill) {
        this.specialSkill = specialSkill;
    }

    public String getCoordinate() {
        return coordinate;
    }

    public void setCoordinate(String coordinate) {
        this.coordinate = coordinate;
        this.bornPosList = new ArrayList<>();
        for (String str : coordinate.split("\\|")) {
            this.bornPosList.add(StringUtils.stringToIntegerList(str, ","));
        }
    }

    public String getOffset() {
        return offset;
    }

    public void setOffset(String offset) {
        this.offset = offset;
        this.offsetList = new ArrayList<>();
        for (String str : offset.split("\\|")) {
            this.offsetList.add(StringUtils.stringToIntegerList(str, ","));
        }
    }

    public List<List<Integer>> getBornPosList() {
        List<List<Integer>> result = new ArrayList<>();
        for (List<Integer> list : bornPosList) {
            result.add(new ArrayList<>(list));
        }
        return result;
    }

    public List<List<Integer>> getOffsetList() {
        List<List<Integer>> result = new ArrayList<>();
        for (List<Integer> list : offsetList) {
            result.add(new ArrayList<>(list));
        }
        return result;
    }
}